<template>
    <div class="my-datalist">
    <el-tree
        :data="items"
        show-checkbox
        node-key="id"
        :props="defaultProps">
    </el-tree>
    </div>
</template>

<script>
export default {
    data() {
        return {
            defaultProps: {
                children: 'children',
                label: 'mapName'
            }
        }
    },
    computed: {
        items(){
            return this.$store.state.mapList.items
        }
        // items: {
        //     get() {
        //         console.log("this.$store.state.mapList.items",this.$store.state.mapList.items)
        //         return this.$store.state.mapList.items || [{mapList: '123',id: 1},{mapList: '456',id: 2}]
        //     }
        // }
    },
    mounted() {
        this.$store.dispatch('getItems')
    }
}
</script>

<style lang="less">
    .my-datalist {
        height: 100%;
        padding: 20px 0;
        box-sizing: border-box;
        overflow-y: auto;
    }
</style>
